using System.Linq;
using UnityEngine;

namespace MaterialUI
{
	public class InputFieldInstantiationHelper : InstantiationHelper
	{
		public const int optionHasIcon = 0;

		public const int optionHasClearButton = 1;

		[SerializeField]
		private MaterialInputField m_MaterialInputField;

		[SerializeField]
		private GameObject m_Icon;

		[SerializeField]
		private GameObject m_ClearButton;

		public override void HelpInstantiate(int[] options)
		{
			if (!options.Contains(0))
			{
				UnityEngine.Object.DestroyImmediate(m_Icon);
				m_MaterialInputField.leftContentTransform = null;
				m_MaterialInputField.leftContentGraphic = null;
			}
			if (!options.Contains(1))
			{
				UnityEngine.Object.DestroyImmediate(m_ClearButton);
				m_MaterialInputField.rightContentTransform = null;
				m_MaterialInputField.rightContentGraphic = null;
			}
			m_MaterialInputField.CalculateLayoutInputHorizontal();
			m_MaterialInputField.SetLayoutHorizontal();
			m_MaterialInputField.CalculateLayoutInputVertical();
			m_MaterialInputField.SetLayoutVertical();
			base.HelpInstantiate(options);
		}
	}
}
